import request from '@/config/axios'

// 风险辨识实例 VO
export interface RiskIdentifyInstanceVO {
  id: number // 主键id
  identifyId: number // 风险辨识id
  instanceId: number // 风险辨识对象id
}

// 风险辨识实例 API
export const RiskIdentifyInstanceApi = {
  // 查询风险辨识实例分页
  getRiskIdentifyInstancePage: async (params: any) => {
    return await request.get({ url: `/zjyj/risk-identify-instance/page`, params })
  },

  // 查询风险辨识实例详情
  getRiskIdentifyInstance: async (id: number) => {
    return await request.get({ url: `/zjyj/risk-identify-instance/get?id=` + id })
  },

  // 新增风险辨识实例
  createRiskIdentifyInstance: async (data: RiskIdentifyInstanceVO) => {
    return await request.post({ url: `/zjyj/risk-identify-instance/create`, data })
  },

  // 修改风险辨识实例
  updateRiskIdentifyInstance: async (data: RiskIdentifyInstanceVO) => {
    return await request.put({ url: `/zjyj/risk-identify-instance/update`, data })
  },

  // 删除风险辨识实例
  deleteRiskIdentifyInstance: async (id: number) => {
    return await request.delete({ url: `/zjyj/risk-identify-instance/delete?id=` + id })
  },

  // 导出风险辨识实例 Excel
  exportRiskIdentifyInstance: async (params) => {
    return await request.download({ url: `/zjyj/risk-identify-instance/export-excel`, params })
  },

  getDeviceInstanceByIdentifyInstanceId: async (identifyInstanceId: number) => {
    return await request.get({ url: `/zjyj/risk-identify-instance/getDeviceInstance?identifyInstanceId=` + identifyInstanceId })
  }
}